package com.robot.base.util.arouter

import android.app.Activity
import android.content.Context
import android.os.Bundle
import com.alibaba.android.arouter.facade.callback.NavCallback
import com.alibaba.android.arouter.launcher.ARouter

object ARouterUtil {

    fun goToActivity(url: String) {
        ARouter.getInstance().build(url).navigation()
    }

    fun goToActivityCallBack(url: String, context: Context, callback: NavCallback) {
        ARouter.getInstance().build(url).navigation(context, callback)
    }

    fun goToActivityResult(url: String, context: Activity,requestCode:Int) {
        ARouter.getInstance().build(url).navigation(context, requestCode)
    }
    fun goToActivityWithBundle(url: String, bundle: Bundle) {
        ARouter.getInstance().build(url).with(bundle).navigation()
    }

    fun goToActivityWithBundleTransition(url: String, bundle: Bundle, in1: Int, out1: Int) {
        ARouter.getInstance().build(url).with(bundle).withTransition(in1, out1).navigation()
    }

    fun goToActivityWithBundleCallBack(
        url: String,
        bundle: Bundle,
        context: Context,
        callback: NavCallback
    ) {
        ARouter.getInstance().build(url).with(bundle).navigation(context, callback)
    }

    fun goToActivityType(url: String, flag: Int) {
        ARouter.getInstance().build(url).withFlags(flag).navigation()
    }

    fun goToActivityBundleType(
        url: String,
        bundle: Bundle,
        flag: Int,
        context: Context,
        callback: NavCallback
    ) {
        ARouter.getInstance().build(url).with(bundle).withFlags(flag).navigation(context, callback)
    }
}